package com.yl.pattern.creatormodel.factory.factory_method;

/**
 * @Author 小羊
 * @Date 29/10/2024下午 8:18
 * @ClassName CoffeeStore
 * @Description CoffeeStore
 */
public class CoffeeStore {
    private CoffeeFactory factory;
    public void setFactory(CoffeeFactory factory){
        this.factory = factory;
    }

    /**
     * 点咖啡功能
     * @return
     */
    public Coffee orderCoffee(){
        Coffee coffee = factory.createCoffee();
        //加配料
        coffee.addMilk();
        coffee.addSugar();

        return coffee;
    }
}
